﻿using System.Windows.Controls;
using Dsl.Ped.Framework.Helpers;

namespace Dsl.Ped.Framework.Extensions
{
    /// <summary>
    /// Extension methods for the <see cref="ContentPresenter"/>
    /// </summary>
    public static class ContentPresenterExtension
    {
        /// <summary>
        /// Set the content based on the given type (IProjective or IProjection).
        /// If the content type is of IProjective, a proper ProjectiveObjectUserControl must be created
        /// for it, otherwise just a content prosenter is created.
        /// </summary>
        /// <param name="contentPresenter">Content presenter which we want to configure</param>
        /// <param name="obj">Object that the presenter is configured with</param>
        public static void SetContentBasedOnType(this ContentPresenter contentPresenter, object obj)
        {
            ContentPresenterHelper.SetContentBasedOnType(contentPresenter, obj);
        }
    }
}
